<template>
    <div class="mock">
        <h1>展示mock数据</h1>
        <ul>
            <li v-for="item in list" :key="item.id">
                <p>{{ item.name }}</p>
             <img :src="item.imgUrl" alt />
            </li>
        </ul>
    </div>
</template>

<script>
import {banner_req} from "@/mockApi/banner"
    export default {

        data(){
            return{
                list:[],
            };
        },
        mounted(){
            this.getBanner();
        },
        methods:{
            async getBanner(){
                const result = await banner_req({
                    methods:"get",
                    url:"/home/banner",
                });
                console.log(result.data.data);
                this.list = result.data.data;
            },
        },
        
    }
</script>

<style lang="scss" scoped>
.mock{
    width:100%;
    height: 100%;
    background: burlywood;
    ul{
        li{
            img{
                width: 100px;
                height: 100px;
            }
        }
    }
}
</style>